<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>
            卷云户外网-修改密码
        </title>
        <jsp:include page="personcommonref.jsp"></jsp:include>
    </head>
    <body id="user">
        <div class="user_cover_bg"></div><!--user box begin-->
        <div class="user_box">
            <%--	公共头部	 --%>
			<jsp:include page="indexHead.jsp" ></jsp:include>
			
			<%--	个人信息公共	begin --%>
			<jsp:include page="personcommon.jsp" ></jsp:include>
			<%--	个人信息公共	end  --%>
			
                <div class="user_box_rg">
                    <ul class="tab">
                        <li>
                            <a href="personinfo.jsp">我的信息</a>
                        </li>
                        <li>
                            <a href="personface.jsp">我的头像</a>
                        </li>
                        <li class="current">
                            <a href="password.jsp">修改密码</a>
                        </li>
                    </ul>
                    <div class="user_password">
                        <h4>
                            <img src="../images/user_pw_sign.jpg">请在此修改您的登录密码。为了防止他人恶意操作，您必须先填写旧密码
                        </h4>
                        <form action="UserAction_resetPwd" method="post" name="/">
                        <div class="user_pay_set">
                            <ul>
                                <li>
                                    <span>原密码:</span><input type="password" name="oldpassword" placeholder="请输入原始密码">
                                    <div id="opwd" style="display: none">
                                        <img src="../images/error_sign.png">
                                    </div>
                                </li>
                                <li>
                                    <span>新密码:</span><input type="password" name="newpassword" placeholder="请输入新密码">
                                    <div id="npwd" style="display: none">
                                        <img src="../images/error_sign.png">
                                    </div>
                                </li>
                                <li>
                                    <span>确认新密码:</span><input type="password" name="repeatpassword" placeholder="请确认密码">
                                    <div id="rpwd" style="display: none">
                                        <img src="../images/error_sign.png">
                                    </div>
                                </li>
                                <li>
                                	<span>&nbsp;</span>
                                    <input type="submit" value="保存" style="padding:0;width:178px;height:36px;background-color: #219BD9;text-align: center;line-height: 36px;color:white;font-size: 16px" onclick="return check()"/>
                                </li>
                            </ul>
                        </div>
                        </form>
                    </div><input type="hidden" id="uniqid" value="">
                </div>
                <script type="text/javascript">
                function check(){
                	var flag = true;
                	var oldpassword = jQuery("input[name='oldpassword']").val();
                	if(oldpassword == "" || oldpassword ==null){
                		layer.open({
						  title: '消息',
						  content: '原密码为空',
						  icon:0,
						  offset: '230px'
						}); 
						flag = false;
						return false;
                	}
                	var newpassword = jQuery("input[name='newpassword']").val();
                	if(newpassword == "" || newpassword ==null){
                		layer.open({
						  title: '消息',
						  content: '新密码为空',
						  icon:0,
						  offset: '230px'
						}); 
						flag = false;
						return false;
                	}
                	var repeatpassword = jQuery("input[name='repeatpassword']").val();
                	if(repeatpassword == "" || repeatpassword ==null){
                		layer.open({
						  title: '消息',
						  content: '确认新密码为空',
						  icon:0,
						  offset: '230px'
						}); 
						flag = false;
						return false;
                	}
                	return flag;
                }
                
                jQuery(document).ready(function(){
                	
                	var rePwd_flag = '${rePwd_flag}';
                	if(rePwd_flag !=null && rePwd_flag == "0" ){
                		layer.open({
							  title: '消息',
							  content: '修改成功',
							  icon:1,
						  offset: '230px'
						}); 
                	}else if(rePwd_flag !=null && rePwd_flag == "1" ){
                		layer.open({
							  title: '消息',
							  content: '旧密码不正确',
							  icon:0,
						  offset: '230px'
						}); 
                	}else if(rePwd_flag !=null && rePwd_flag == "2" ){
                		layer.open({
							  title: '消息',
							  content: '密码不一致',
							  icon:0,
						  offset: '230px'
						}); 
                	}
                });


                </script>
            </div>
        </div><!--user box end-->
        
        <%--	公共底部	 --%>
		<jsp:include page="indexFooter.jsp" />
		
    </body>
</html>
